package com.learn.springcloud.hystrixexplainindetailconsumer.command.naming.service;

import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;
import com.netflix.hystrix.HystrixCommandKey;
import com.netflix.hystrix.HystrixThreadPoolKey;
import org.springframework.web.client.RestTemplate;

/**
 * 线程池划分
 * @Time : 2018/8/3 17:59
 * @Version : 1.0
 */
public class ThreadPoolPartitionExtendsWay extends HystrixCommand<String> {

    private RestTemplate restTemplate;
    private String name;

    public ThreadPoolPartitionExtendsWay(RestTemplate restTemplate, String name) {
        super(
            Setter.withGroupKey(
                HystrixCommandGroupKey.Factory.asKey("111"))
                .andCommandKey(HystrixCommandKey.Factory.asKey("2222"))
                .andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey("333"))
        );
        this.restTemplate = restTemplate;
        this.name = name;
    }

    @Override
    protected String run() throws Exception {
        return null;
    }
}
